package main

import "fmt"

//接口
type Usb interface {
	Start()
	Stop()
}
type Usb2 interface {
	Start()
	Stop()
}
type Phone struct {
}

func (p *Phone) Start() {
	fmt.Println("手机开始工作")
}
func (p *Phone) Stop() {
	fmt.Println("手机停止工作")
}

type Cmera struct {
}

func (p *Cmera) Start() {
	fmt.Println("相机开始工作")
}
func (p *Cmera) Stop() {
	fmt.Println("相机停止工作")
}

type Computer struct {
}

func (c *Computer) Working(usb Usb) {
	usb.Start()
}

func main() {
	c := &Computer{}
	camera := Cmera{}
	p := &Phone{}
	c.Working(&camera)
	c.Working(p)
}
